import pymysql

def cursor():
    conn = pymysql.connect(
        host='127.0.0.1',
        user='root',
        password="123456",
        database='students',
        port=3306,
        charset='utf8'
    )

    # 创建连接对象
    cursor = conn.cursor()
    return cursor

def consor_close():
    cursor().close();


